

<center>
  <div style="width: 95%;">
    <p>
      <%= f.label "Disciplines" %><br/>
      <p style="color: #666666;">
        You belong to the following disciplines:
      </p>
      <table style="width:100%;">
        <tr>
          <td>
            <div id="assay_list_collection">
              <%= f.label :available_disciplines %><br/>
              <%= select_tag :possible_disciplines,options_for_select( Discipline.find(:all).collect{|d| [h("#{d.title}"),d.id]} ),:style => "width: 15em;" %>
              <b><%= link_to_function "Add","addSelectedDiscipline(); return(false);" %></b>
            </div>
          </td>
          <td id="discipline_to_list" class="box_editing_inner" style="line-height: 1.5; width:60%;text-align:left;">
            <span class="none_text" id="disciplines">Loading...</span>
          </td>          
        </tr>
      </table>

      <%= f.collection_select :discipline_ids,[],:id,:title,{},:multiple=>true,:style=>"display:none;" %>


    </p>
  </div>
</center>

<script type="text/javascript">
<% @person.disciplines.each do |d| -%>
    discipline_id = <%= d.id -%>;
    discipline_title = '<%= d.title -%>';
    addDiscipline(discipline_title,discipline_id);
<% end -%>

  updateDisciplines();
</script>